#ifndef __SIMPLE_BARRIER_H__
#define __SIMPLE_BARRIER_H__

#include "IBarrier.h"
#include "cpp_framework.h"

class SimpleBarrier : IBarrier {
private:
	CMDR::AtomicInteger _count;
	unsigned int _size;
	
public:
	
	/* C'tor */
	SimpleBarrier(int n) : _size(n)
	{
		_count.set(n);
	}
	/* D'tor */
	virtual ~SimpleBarrier() {}
	
	/*
	 * Impl of the pure virtual function.  
	 */	
	void await();
};

#endif /*__SIMPLE_BARRIER_H__*/
